//
//  XYWeakProxy.m
//  面试-消息转发机制
//
//  Created by lxy on 2017/11/24.
//  Copyright © 2017年 lxy. All rights reserved.
//

#import "XYWeakProxy.h"

@implementation XYWeakProxy

+ (instancetype)proxyWithTargrt:(id)target {
    return [[XYWeakProxy alloc] initWithTarget:target];
}

- (instancetype)initWithTarget:(id)target {
    _target = target;
    return self;
}

- (BOOL)respondsToSelector:(SEL)aSelector {
    return [_target respondsToSelector:aSelector];
}


- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel {
    return [_target methodSignatureForSelector:sel];
}


- (void)forwardInvocation:(NSInvocation *)invocation {
    [invocation invokeWithTarget:_target];
}

@end
